from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action

class Stupid(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # add inventory items
        #self.add_item(Keys())
        
        # build list of actions
        #self.add_action(Exit)
        self.add_action(goGradLounge)
        self.add_action(goCouncilRoom)
        self.add_action(goBallroom)
        self.add_action(GoDeanOffice)
    # return description of room.
    def get_description(self):
        return "Ew. WTF are you doing here?"
    
    # return image of room
    def get_video(self):
        return 'stupid.mp4'


class StupidRoomHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return Stupid

# define actions for this room


class goGradLounge(Action):
        def __init__(self):
            Action.__init__(self, "goGradLounge")    # do basic initialization for every action
        
# return description of action (used in label on webpage)
        def get_description(self):
            return "Go to Grad Lounge"
    
    # go to the Grad Lounge
        def get_destination(self):
            return 'gradlounge'
    
    # set cutscene for when arrive in entrance_hall
    #    def do_action(self,game,room,request):
    #        if self.room.grad_lounge_locked:
    #            set_cutscene("You can't enter that room because the door is locked.")
    #            return
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
        def get_method(self):
            return "get"
    
    # enabled only if room is lit.
#        def is_enabled(self):
#            if self.room.is_illuminated():
#                return True
#            else:
#                return False
    
class goCouncilRoom(Action):
    def __init__(self):
        Action.__init__(self, "goCouncilRoom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to Council Room"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'councilroom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
        
class goBallroom(Action): 
    def __init__(self):
        Action.__init__(self, "goBallroom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to Ballroom"
    
    # return id of room to enter when action is complete
    # this is where we check if we have the prerequisites for going into the room
    def get_destination(self):
        return 'ballroom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    
   
class GoDeanOffice(Action):
    def __init__(self):
        Action.__init__(self, "GoDeanOffice")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to Dean Freeman's Office"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'deanoffice'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"